package com.iflytek.cosmo.ocr.support.license;

/**
 * @author <a href=mailto:ktyi@iflytek.com>伊开堂</a>
 * @date 2021/2/3
 */
public enum LicenseVersion {
    V1(1, "服务器与客户端都基于mac地址标识唯一性"),
    V2(2, "服务器基于/etc/machine-id标识唯一性"),
    ;

    LicenseVersion(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    private int code;
    private String desc;

    public int getCode() {
        return code;
    }

    public static LicenseVersion parseFromCode(int code) {
        for (LicenseVersion version : values()) {
            if (version.code == code) {
                return version;
            }
        }

        return null;
    }
}
